This topic describes functions that you can use to manipulate tabular data.
Function | Description and Example |
---|---|
tableGetRows(table) |
Gets a list of rows from a table object. The following example returns a list, such as [[0,1,4,"v"],[1,3,2,"a"],[2,2,6,"k"]]. tableGetRows(@parent.table); |
tableGetColumns(table) |
Gets a list of information about columns in a table object. The following function returns a list, such as [...{"name":"v1","type":"string","width":100,"formula":null,"meta":{"name":"v1"}}...]. tableGetColumns(@parent.table); |
tableSet(table,rows,[columns], serialize=true) |
Sets data in the specified table. The row column is added automatically and contains automatically generated row IDs. The following function erases all data in the table, adds two new rows, and adds the specified column headers. A row column is also automatically created. tableSet(@parent.table,[["a","b"],["c","d"]],["col1","col2"]); |
tableAddRows(table, rows) |
Adds rows to a table object. A dummy value must be passed as the first item in any row. This dummy value will always be overriden by the automatically generated row ID in the row column. The following function adds two rows to the table. tableAddRows(@parent.table,[["","a","b"],["","c","d"]]); |
tableRemoveRows(table, start, [count=1]) |
Removes a number of rows from table object. The following function removes two rows from a table, beginning with the row at index 0. tableRemoveRows(@parent.table, 0, 2); |
tableClear(table) |
Clears the table. The following function removes all rows from a table. Columns remain. tableClear(@parent.table); |
$thisRow['column Name'] |
Selects the column value from the current row being iterated on by a Filter or Column Mapping block. If the column name contains no spaces, the column name alone can be used in place of $thisRow['column Name']. For more examples, see Column Mapping and Filter. The following example demonstrates how to use $thisRow: =$thisRow['Energy Usage'].indexOf("History") > -1 The new column contains a TRUE value in each row where the string "History" appears in the Energy Usage column and a FALSE value in each row where the string "History" does not appear. |